<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="grupobbva.pe.operhc.domain.SegUsuario"%>
<%@page import="grupobbva.pe.operhc.util.Utilities"%>
<%@ taglib uri="http://struts.apache.org/tags-bean"  prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"   prefix="c" %>

<%@page import="grupobbva.pe.operhc.util.Constant"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
SegUsuario usuarioSession = (SegUsuario)request.getSession().getAttribute("usuarioSession");
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Ofertas Dinámicas</title>
	<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath()%>/css/ui.jqgrid.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath()%>/css/redmond/jquery-ui-1.8.2.custom.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath()%>/css/operhc_style.css" />
	
	<script type="text/javascript" src='<%= request.getContextPath()%>/dwr/interface/ProductoPlazoAction.js'></script>
	<script type="text/javascript" src='<%= request.getContextPath()%>/dwr/interface/ConsultaActualAction.js'></script>
	<script type='text/javascript' src='<%= request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%= request.getContextPath()%>/dwr/util.js'></script>
	<script src="<%=request.getContextPath()%>/js/util/gridUtil.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/jquery-1.7.1.js" type="text/javascript"></script>	
	<script src="<%=request.getContextPath()%>/js/i18n/grid.locale-es.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/jquery.jqGrid.src.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/js/grid.subgrid.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/carrusel/jquery.roundabout.min.js" type="text/javascript"></script>
	<script src="<%=request.getContextPath()%>/carrusel/jquery.roundabout-shapes.min.js" type="text/javascript"></script>

<script type="text/javascript" charset="UTF-8">

var rutaContexto1 = location.pathname;
var rutaContexto2 = "<%=request.getContextPath()%>";
var rutaContexto  = rutaContexto1.substr(0, rutaContexto1.indexOf(rutaContexto2)) + rutaContexto2;

var FAMILIA_TARJETAS = '<%=Constant.FAMILIA_TARJETAS%>';
var FAMILIA_PRESTAMOS = '<%=Constant.FAMILIA_PRESTAMOS%>';

var FLAG_ADMIN_TITLE = '<%=usuarioSession.getAdmin()%>';

var PORCENTAJE_SEGURO = <%=Utilities.PORCENTAJE_SEGURO%>;
var PORTES_COMISION = <%=Utilities.PORTES_COMISION%>;

function viewProductCalculator(idGenerado, rowId, operation, indicatorSelect){
	showLoading();
	var formulario = document.getElementById('formOfertasDinamicas');		
	if(operation != ''){
		var codPlazo = document.getElementById("arrayCodPlazo"+"-"+idGenerado+"-"+rowId).value;
		var codProducto = document.getElementById("arrayCodProducto"+"-"+idGenerado+"-"+rowId).value;
		var codConfigProducto = document.getElementById("arrayCodConfigProd"+"-"+idGenerado+"-"+rowId).value;
		var idSubProducto = document.getElementById("arrayIDSubProducto"+"-"+idGenerado+"-"+rowId).value;
		document.getElementById('indicatorInitial').value = codPlazo+"|"+codProducto+"|"+codConfigProducto+"|"+idSubProducto;
	}
	
	var limiteContrato	= document.getElementById("arrayLimiteContrato"+"-"+idGenerado+"-"+rowId);
	var tasa = document.getElementById("arrayTasa"+"-"+idGenerado+"-"+rowId);
	
	if(isNaN(limiteContrato.value) || $.trim(limiteContrato.value) == ''){
		limiteContrato.value = '0.00';
	}
	
	if(isNaN(tasa.value) || $.trim(tasa.value) == ''){
		tasa.value = '0.00';
	}
	
	formulario.action = rutaContexto+'/consultaActualForm.do?method=verCalculoProductos&indicatorSelect='+indicatorSelect;
	formulario.submit();
}

</script>

<script src="<%=request.getContextPath()%>/js/util/encabezado.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/util/formatters.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/util/ofertasDinamicas.js" type="text/javascript"></script>
	
<style>
   .roundabout-holder {
      list-style: none;
      padding: 0;
      margin: 0;
      height: 50em;
      width: 100em;
      
   }
   .roundabout-moveable-item {
      height: 50em;
      width: 75em;
      cursor: pointer;
      background-color: #F5FAFF;
      border: 1px solid #BBB;
      overflow: auto;
   }
   .roundabout-in-focus {
      cursor: auto;
   }
   
   ul {
   list-style-type: none;
   }
   
   li {
   float: left;
   margin-right:10px;
   margin-bottom:10px;
   width: 80em;
   background-color: #F5FAFF;
   border: 1px solid #BBB;
   }
</style>
</head>
<body onload="loadInitialProducts();">
<html:form styleId="formOfertasDinamicas" method="post" acceptCharset="utf-8">
<input type='hidden' name="indicatorInitial" id="indicatorInitial" value="<c:out value="${command.indicatorInitial}"/>" />

<table align="center">
<tr><td id="tableMainBody" valign="top" align="center"></td></tr>
</table>
</html:form>
</body>
</html>